import request from '@/utils/request';

// 查询品牌商列表
export function listBrand(query) {
	return request({
		url: '/mall/brand/list',
		method: 'post',
		data: query,
	});
}

// 查询品牌商详细
export function getBrand(id) {
	return request({
		url: '/mall/brand/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增品牌商
export function addBrand(data) {
	return request({
		url: '/mall/brand/add',
		method: 'post',
		data: data,
	});
}

// 编辑品牌商
export function updateBrand(data) {
	return request({
		url: '/mall/brand/edit',
		method: 'post',
		data: data,
	});
}

// 删除品牌商
export function delBrand(id) {
	return request({
		url: '/mall/brand/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出品牌商
export function exportBrand(query) {
	return request({
		url: '/mall/brand/export',
		method: 'post',
		params: query,
	});
}

export const listBrandAll = () => {
	return request({
		url: '/mall/brand/listAll',
		method: 'post',
	});
};
